﻿<%@ Page
    Language="C#"
    AutoEventWireup="true"
    MasterPageFile="~/Global.master"
    CodeBehind="Default.aspx.cs"
    Inherits="Ria.Presentation.Web._Default" %>

<asp:Content 
    ID="demoContent"
    ContentPlaceHolderID="contentPlaceHolder" 
    Runat="Server">
    
    <gaia:Panel
        runat="server"
        ID="gpFlexOne"
        BorderColor="DarkGray"
        BorderStyle="Solid"
        BorderWidth="1"
        Width="500">
        
        <fc:FlexContainer
            ID="fcControlOne"
            runat="server"
            Width="500px"
            Height="260px"
            FlexFile="Flex/FlexControls.swf"
            FlexState="controlOne"
            OnIncomingObjectEvent="fc1IncomingObject"
            ShowFlashMenu="false" />
    </gaia:Panel>
    <br /><br />
    <gaia:Panel
        runat="server"
        ID="gpAjaxContent"
        BorderColor="DarkGray"
        BorderStyle="Solid"
        BorderWidth="1"
        BackColor="#F3F3F3"
        Width="500"
        HorizontalAlign="Center">
        <div style="font-weight:bold; text-align:left;padding:7px 0 7px 10px;">AJAX Area</div>
        <gaia:TextBox
            ID="gtbLog"
            runat="server"
            TextMode="MultiLine"
            Width="480px"
            Height="80px" />
        <div style="font-weight:bold; text-align:left;padding:7px 0 7px 10px;">
           <gaia:Button runat="server" ID="gbSayHello" Text="Hello to Flex" OnClick="OnSayHello" />
           <gaia:Button runat="server" ID="gbLink" Text="Add to Control One" OnClick="OnAddRecord" />
        </div>
    </gaia:Panel>
    <br /><br />
    <gaia:Panel
        runat="server"
        ID="gpFlexTwo"
        BorderColor="DarkGray"
        BorderStyle="Solid"
        BorderWidth="1"
        Width="500">
        
        <fc:FlexContainer
            ID="fcControlTwo"
            runat="server"
            Width="500px"
            Height="120px"
            FlexFile="Flex/FlexControls.swf"
            FlexState="controlTwo"
            InitialData="Hello from .NET (InitialData)"
            OnIncomingObjectEvent="fc2IncomingObject"
            ShowFlashMenu="false"/>
    </gaia:Panel>

</asp:Content>

<asp:Content 
    ID="info"
    ContentPlaceHolderID="infoPlaceHolder" 
    Runat="Server">
    <h1>ASP.NET FlexContainer control and Flex control library demo</h1>
    This page contains 2 FlexContainer(-s) referencing one flex library FlexControls.swf
    <br />Here's the brief overview of a lifecycle and some highlights:
    <ul>
    <li style="color:Red;">No custom client script is used</li>
    <li style="color:Red;">No Flex server technology is used</li>
    <li style="color:Red;">All events from Flex are handled and processed in .NET, like any other AJAX request</li>
    <li style="color:Red;">All calls to Flex from .NET are handled as a regular ActionScript events</li>
    <li>Page references a single SWF - &quot;flex control library&quot; from two FlexContainer controls</li>
    <li>After SWF is loaded, it shows specific control based on <strong>FlexContainer.State</strong> attribute</li>
    <li>Once the Flex state is loaded, an optional <strong>FlexContainer.InitialData</strong> attribute (either plain or JSON string) is used for data initialization</li>
    <li>Flex events routed to the browser and gets posted back as AJAX requests (Gaia)</li>
    <li>Calls to Flex from .NET done by <strong>FlexContainer.FlexCallObject(JsonObject arg)</strong> method</li>
    <li>Click <gaia:LinkButton ID="glbNoStates" runat="server" Text="here" OnClick="glbNoStatesClicked"/> to see sample page embedding single Flex (no states are used)</li>
    </ul>
</asp:Content>
